<template>
  <div class="navbar-container">
    <van-nav-bar class="navbar" :title="title">
      <template #left v-if="isBack">
        <div class="back" @click="onBack">
          <van-icon name="arrow-left" color="#333" />
        </div>
      </template>
    </van-nav-bar>

    <div class="navbar-placholder"></div>
  </div>
</template>

<script>
export default {
  data() {
    return {}
  },
  props: {
    title: {
      type: String,
      default: ''
    },
    isBack: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    onBack() {
      this.$router.go(-1)
    },
    onClickRight() {
      this.$toast('按钮')
    }
  },
  mounted() {}
}
</script>

<style lang="css" scoped>
.navbar-container {
}
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}
.navbar-placholder {
  margin-bottom: 10px;
  height: 46px;
}
</style>
